package carol.pvp.analyzer.impl;

import wangy.pvp.basiclibrary.basicType.AssBasicType;
import carol.pvp.analyzer.CodeAnalyzer;

/**
 * 
 * @author carol
 *
 */
public abstract class CodeAnalyzerImpl implements CodeAnalyzer{
	protected CodeTypeChecker checker;
	protected CodeInfoCatcher catcher;
	
	public AssBasicType analyze(String code){
		AssBasicType info = null;
		
		if(checker.checkPackage(code)){
			info = catcher.catchPackge(code);
		}
		else if(checker.checkClass(code)){
			info = catcher.catchClass(code);
		}
		else if(checker.checkMethod(code)){
			info = catcher.catchMethod(code);
		}
		else{
			info = catcher.catchOther();
		}
		
		return info;
	}
}
